home *** CD-ROM | disk | FTP | other *** search
/ Mastering Web Site Development / Microsoft Mastering Web Site Development (Microsoft) (1997).iso / Media / Ch08 / W08D040.cc2 < prev    next >
Text File  |  1997-04-24  |  1KB  |  27 lines

  1. 0, In this demonstration, you will see how to call an 
  2. 4, ActiveX server component created by Visual Basic 
  3. 7, 5.0 from an Active Server Page. I will create a new 
  4. 11, Active Server Page that will take a number 
  5. 13, submitted from a form, square it, and return the result. 
  6. 17, I'll create the page by choosing File, New. I'll 
  7. 22, select Active Server Page, and type in a name ù 
  8. 26, Square. I'll add server-side script to create the 
  9. 33, Math object in a variable called X by using the 
  10. 36, Server.CreateObject method. I'll pass the ProgID, 
  11. 47, Math.Square, as the argument. Next, I'll call the 
  12. 56, Squareit method on the X variable, passing the integer 
  13. 59, that was submitted by the form. The variable is 
  14. 68, called num, and I'll retrieve it from the Request 
  15. 70, object. Because the equal sign is at the beginning 
  16. 79, of the script, the value will be printed to the 
  17. 81, page. Now, I'll save the page, and test calling it from 
  18. 84, a form. The form to call this with is called 
  19. 92, squarenumbers.htm. I'll preview it in the browser. 
  20. 98, I'll type in a value of 5, and submit the form. The 
  21. 102, square.asp file is retrieved, which uses the Math 
  22. 105, component to calculate the result and return it back 
  23. 108, to the browser on a new HTML page. Here you can 
  24. 111, see that it returned the result, which was 25. 
  25. 114, Server.CreateObject can be used to create any ActiveX server 
  26. 118, components, including those created by Visual Basic.
  27. 123, END